define(
['ash',
    'game/constants/GameConstants', 'game/constants/WorldCreatorConstants', 'game/constants/PositionConstants', 'game/constants/MovementConstants'],
function (Ash, GameConstants, WorldCreatorConstants, PositionConstants, MovementConstants) {

    SECTOR_TYPE_NOLIGHT = -1;
    
    var TextConstants = {
	
		densityBrackets: [
			[0, 0], [1, 4], [5, 8], [9, 10]
		],
		
		repairBrackets: [
			[0, 1], [2, 4], [5, 7], [8, 10]
		],
		
		sectorDescriptions: {
		},
        
        getActionName: function (baseActionID) {
            switch (baseActionID) {
                case "scout_locale_i":
                case "scout_locale_u":
                    return "侦察";
				case "scavenge":
					return "搜索";
				case "scout":
					return "侦察";
                default:
                    return baseActionID;
            }
        },
		
		getSectorDescription: function (hasLight, sunlit, sectorType, density, repair) {
			if (!hasLight) {
				sectorType = SECTOR_TYPE_NOLIGHT;
			}
			 
			var densityBracket = this.getDensityBracket(density);
			var repairBracket = this.getRepairBracket(repair);
			
			var description = this.sectorDescriptions[sectorType][densityBracket][repairBracket];
			if (description && sunlit) {
				description = description.replace("artificial light", "sunlight");
				description = description.replace("vast darkness", "vast brightness");
			}
			return description;
		},
		
        getPassageFoundMessage: function (passageVO, direction, sunlit) {
            switch (passageVO.type) {
                case MovementConstants.PASSAGE_TYPE_HOLE:
                    if (direction === PositionConstants.DIRECTION_UP) {
                        if (sunlit)
                            return "天花板上有个洞。刺眼的阳光从它里面流进来。";
                        else
                            return "在天花板上有一个洞，一个通向黑暗的口。";
                    } else {
                        if (sunlit)
                            return "这里有个巨大的深坑。街道在下面是可见的，令人眼花缭乱。";
                        else
                            return "这里有个巨大的深坑。下面只有巨大的空洞。";
                    }
                default:
                    return "曾经有" + TextConstants.addArticle(cnItem(passageVO.name.toLowerCase())) + "在这里。";
            }
        },
        
        getPassageRepairedMessage: function (passageType, direction, sectorPosVO) {
            var directionName = (direction === PositionConstants.DIRECTION_UP ? " 上行" : " 下行");
            switch (passageType) {
                case MovementConstants.PASSAGE_TYPE_HOLE:
                    return "电梯 " + directionName + " 建在 " + sectorPosVO.getInGameFormat(true);
                case MovementConstants.PASSAGE_TYPE_ELEVATOR:
                    return "电梯 " + directionName + " 修复在 " + sectorPosVO.getInGameFormat(true);
                case MovementConstants.PASSAGE_TYPE_STAIRWELL:
                    return "楼梯井 " + directionName + " 修复在 " + sectorPosVO.getInGameFormat(true);
                default:
                    console.log("WARN: Unknown passage type: [" + passageType + "]")
                    return "通道 " + directionName + " 准备好了在 " + sectorPosVO.getInGameFormat(true);
            }
        },
        
        /*
        There is a hole in the level ceiling here. An elevator has been built,
        /**/
        
        getPassageDescription: function (passageVO, direction, isBuilt) {
            var makeHighlight = function (content) { return "<span class='hl-functionality'>" + content + "</span>"; };
            var directionName = (direction === PositionConstants.DIRECTION_UP ? " 向上的" : " 向下的");
            switch (passageVO.type) {
                case MovementConstants.PASSAGE_TYPE_HOLE:
                    if (isBuilt) {
                        return "一个全新的" + makeHighlight("elevator " + directionName) + " 已经在这里建好了。";
                    } else {
                        return "这里有一个" + makeHighlight("洞") + " 在这层的 " + (direction === PositionConstants.DIRECTION_UP ? "天花板上" : "地板上") + " 。";
                    }
                default:
                    var name = cnItem(passageVO.name.toLowerCase()) + " " + directionName;
                    var article = TextConstants.getArticle(name);
                    var span = article + " " + makeHighlight(name);
                    var state;
                    if (isBuilt) {
                        state = "已经维修过了";
                    } else if (passageVO.type === MovementConstants.PASSAGE_TYPE_ELEVATOR) {
                        state = "但已经坏了";
                    } else {
                        state = "但是需要修理";
                    }
                    return "这里有" + span + "," + state + ".";
            }
        },
        
		getLogResourceText: function (resourcesVO) {
			var msg = "";
			var replacements = [];
			var values = [];
			for (var key in resourceNames) {
				var name = resourceNames[key];
				var amount = resourcesVO.getResource(name);
				msg += "$" + replacements.length + ", ";
				replacements.push("#" + replacements.length + " " + name);
				values.push(Math.round(amount));
			}
			msg = msg.slice(0, -2);
			return { msg: msg, replacements: replacements, values: values };
		},
        
        getLogItemsText: function (items) {
            var msg = "";
            var replacements = [];
            var values = [];
            var loggedItems = {};
            for (var i = 0; i < items.length; i++) {
                var item = items[i];
                if (typeof loggedItems[item.id] === 'undefined') {
                    msg += "$" + replacements.length + ", ";
                    replacements.push("#" + replacements.length + " " + item.name.toLowerCase());
                    values.push(1);
                    loggedItems[item.id] = replacements.length - 1;
                } else {
                    values[loggedItems[item.id]]++;
                }
            }
            msg = msg.slice(0, -2);
            if (Object.keys(loggedItems).length > 1) {
                var lastCommaIndex = msg.lastIndexOf(",");
                msg = msg.substring(0, lastCommaIndex) + " 和" + msg.substring(lastCommaIndex + 1);
            }
            return {msg: msg, replacements: replacements, values: values};
        },
        
        createTextFromLogMessage: function (msg, replacements, values, includePeriod) {
            var text = msg;
			var value = 0;
			var useValues = values.length > 0;
			for (var i = 0; i < replacements.length; i++) {
				replacements[i] = replacements[i].replace("water", "水");
				replacements[i] = replacements[i].replace("food", "食物");
				replacements[i] = replacements[i].replace("metal", "金属");
				replacements[i] = replacements[i].replace("rope", "绳索");
				replacements[i] = replacements[i].replace("fuel", "燃料");

				if (useValues) {
					value = values[i];
				}
				if (value > 0 || value.length > 0 || !useValues) {
					text = text.replace("$" + i, replacements[i]);
				} else {
					text = text.replace("$" + i, "");
				}
				
				if (useValues) {
					text = text.replace("#" + i, values[i]);
				}
			}
            text = text.trim();
			text = text.replace(/ ,/g, "");
			text = text.replace(/^,/g, "");
			text = text.replace(/,$/g, "");
			text = text.replace(/\, \./g, ".");
			text = text.replace(/, /, "，");
			if (includePeriod && text.substr(text.length - 1) !== "." && text.substr(text.length - 1) !== "!")
                text += "";
            text = text.trim();
//			console.log(text);
            return text;
        },
		
		getLocaleName: function (locale, sectorRepair, isShort) {
			var repairBracket = this.getRepairBracket(sectorRepair);
			switch (locale.type) {
			case localeTypes.factory:
                if (isShort) return "工厂";
				if (repairBracket === this.repairBrackets[0][0]) return "毁坏的工厂" ;
				if (repairBracket === this.repairBrackets[1][0]) return "废弃的工厂";
				if (repairBracket === this.repairBrackets[2][0]) return "废弃的工厂";
				return "空荡荡的工厂";
			case localeTypes.house:
                if (isShort) return "房屋";
				if (repairBracket === this.repairBrackets[0][0]) return "毁坏的房屋";
				if (repairBracket === this.repairBrackets[1][0]) return "破败的房屋";
				if (repairBracket === this.repairBrackets[2][0]) return "无人关注的房屋";
				return "空荡荡的房屋";
			case localeTypes.lab:
                if (isShort) return "设施";
				if (repairBracket < this.repairBrackets[0][2]) return "毁坏的实验室";
				return "废弃的实验室";
			case localeTypes.grove:
                if (isShort) return "小树林";
				return "茂盛的小树林";
			case localeTypes.market:
                if (isShort) return "建筑";
				if (repairBracket === this.repairBrackets[0][0]) return "毁坏的市场";
				if (repairBracket === this.repairBrackets[1][0]) return "废弃的商店";
				if (repairBracket === this.repairBrackets[2][0]) return "废弃的购物中心";
				return "寂静的购物大楼";
			case localeTypes.maintenance:
                if (isShort) return "设施";
				if (repairBracket === this.repairBrackets[0][0]) return "旧水塔";
				if (repairBracket === this.repairBrackets[1][0]) return "失效的控制单元";
				if (repairBracket === this.repairBrackets[2][0]) return "古老的网络交换机";
				return "电箱";
			case localeTypes.transport:
                if (isShort) return "车站";
				if (repairBracket === this.repairBrackets[0][0]) return "毁坏的火车站";
				if (repairBracket === this.repairBrackets[1][0]) return "腐朽的缆车站";
				if (repairBracket === this.repairBrackets[2][0]) return "废弃的火车站";
				return "空旷的缆车站";
			case localeTypes.sewer:
                if (isShort) return "下水道";
				if (repairBracket === this.repairBrackets[0][0]) return "被破坏的下水道";
				return "寂静的下水道";
			case localeTypes.warehouse:
                if (isShort) return "仓库";
				if (repairBracket === this.repairBrackets[0][0]) return "毁坏的仓库";
				if (repairBracket === this.repairBrackets[1][0]) return "D腐朽的仓库";
				if (repairBracket === this.repairBrackets[2][0]) return "废弃的仓库";
				return "坚固的仓库";
			case localeTypes.camp:
            case localeTypes.tradingpartner:
                return isShort ? "Camp" : "其他营地";
			case localeTypes.hut:
			case localeTypes.hermit:
                return isShort ? "Hut" : "Lone hut";
			case localeTypes.caravan: return isShort ? "Caravan" : "Trade caravan";
			default: return "Building";
			}
		},
		
		getWorkshopName: function (resource) {
			switch (resource) {
			case resourceNames.fuel: return "refinery";
			default: return "workshop";
			}
		},
		
		getSpringName: function (featuresComponent) {
			if (featuresComponent.stateOfRepair < 4) {
				return "漏水的水管";
			}
			switch (featuresComponent.sectorType) {
				case WorldCreatorConstants.SECTOR_TYPE_SLUM:
					return "井";
			}
			return "水塔";
		},
		
		getDirectionName: function (direction) {
			switch (direction) {
			case PositionConstants.DIRECTION_WEST: return "west";
			case PositionConstants.DIRECTION_NORTH: return "north";
			case PositionConstants.DIRECTION_SOUTH: return "south";
			case PositionConstants.DIRECTION_EAST: return "east";
			case PositionConstants.DIRECTION_UP: return "up";
			case PositionConstants.DIRECTION_DOWN: return "down";
			case PositionConstants.DIRECTION_CAMP: return "camp";
			}
		},
		
		getEnemyText: function (enemyList, sectorControlComponent) {
			var result = "";
			var enemyActiveV = this.getEnemyActiveVerb(enemyList);
			var enemyNounSector = this.getEnemyNoun(enemyList, true);
            result += cnItem(enemyActiveV) + " " + cnItem(enemyNounSector);
			return result;
		},
		
		getEnemyNoun: function (enemyList, detailed) {
			var baseNoun = this.getCommonText(enemyList, "nouns", detailed? "name" : "", "someone or something", true);
			if (detailed) {
				return baseNoun;
			} else {
				var parts = baseNoun.split(" ");
				return cnItem(parts[parts.length - 1]);
			}
		},
        
        getEnemyGroupNoun: function (enemyList) {
            return this.getCommonText(enemyList, "groupN", "", "group", false)
        },
		
		getEnemyActiveVerb: function(enemyList) {
			return this.getCommonText(enemyList, "activeV", "", "occupied by", false);
		},
		
		getEnemeyDefeatedVerb: function(enemyList) {
			return this.getCommonText(enemyList, "defeatedV", "", "defeated", false);
		},
        
        getMovementBlockerName: function(blockerVO, enemiesComponent) {
			switch (blockerVO.type) {
                case MovementConstants.BLOCKER_TYPE_GANG:
                    var groupNoun = this.getEnemyGroupNoun(enemiesComponent.possibleEnemies);
                    var enemyNoun = this.getEnemyNoun(enemiesComponent.possibleEnemies);
                    return groupNoun + " " + enemyNoun;
                default:
                    return blockerVO.name;
            }
        },
        
        getMovementBlockerAction: function (blockerVO, enemiesComponent) {
			switch (blockerVO.type) {
				case MovementConstants.BLOCKER_TYPE_GAP: return "桥梁距离";
				case MovementConstants.BLOCKER_TYPE_WASTE: return "清除废物";
				case MovementConstants.BLOCKER_TYPE_GANG: return "战斗 " + this.getEnemyNoun(enemiesComponent.possibleEnemies);
	 	 	}
        },
		
		getUnblockedVerb: function (blockerType) {
			switch (blockerType) {
				case MovementConstants.BLOCKER_TYPE_GAP: return "已连接";
				case MovementConstants.BLOCKER_TYPE_WASTE: return "已清理";
				case MovementConstants.BLOCKER_TYPE_GANG: return "被打败";
	 	 	}
		},
		
		getDensityBracket: function (density) {
			for (var d = 0; d < this.densityBrackets.length; d++) {
				var densityBracket = this.densityBrackets[d];
				if (density >= densityBracket[0] && density <= densityBracket[1]) {
					density = densityBracket[0];
					break;
				}
			}
			return density;
		},
		
		getRepairBracket: function (repair) {
			for (var r = 0; r < this.repairBrackets.length; r++) {
				var repairBracket = this.repairBrackets[r];
				if (repair >= repairBracket[0] && repair <= repairBracket[1]) {
					repair = repairBracket[0];
					break;
				}
			}
			return repair;
		},
		
		// get common description word for a list of objects that contain possible words are in arrays named objectAttribute
		// if nothing common is found, defaultWord is returned
		// is allowSeveral, two common words can be returned if one doesn't cover all objects
		getCommonText: function (objectList, objectAttribute, objectDetailAttribute, defaultWord, allowSeveral) {
			var allWords = [];
			var allDetails = [];
			var minimumWords = [];
			for (var i1 in objectList) {
				var o = objectList[i1];
				if (o) {
					for (var j1 in o[objectAttribute]) {
					var word = o[objectAttribute][j1];
					var detail = objectDetailAttribute ? o[objectDetailAttribute] : "";
					if ($.inArray(word, allWords) < 0) allWords.push(word);
					if (objectDetailAttribute && $.inArray(detail, allDetails) < 0) allDetails.push(detail);
					if (j1 == 0 && $.inArray(word, minimumWords) < 0) minimumWords.push(word);
					}
				}
			}
			
			var validWords = [];
			for (var i2 in allWords) {
				var word = allWords[i2];
				var valid = true;
					for (var j2 in objectList) {
					var o = objectList[j2];
					if ($.inArray(word, o[objectAttribute]) < 0) valid = false;
				}
				if (valid) validWords.push(word);
			}
			
			var validDetail = "";
			if (objectDetailAttribute) {
			for (var i3 in allDetails) {
				var detail = allDetails[i3];
				var valid = true;
				for (var j3 in objectList) {
					var o = objectList[j3];
					if (o[objectDetailAttribute] != detail) valid = false;
					}
					if (valid) validDetail = detail;
				}
			}
			
            // console.log("getCommonText " + objectAttribute + " | " + validDetail + " | " + validWords.join(",") + " | " + minimumWords.join(",") + " | " + defaultWord);
            // console.log(objectList)
            
			if (validDetail.length > 0) {
				return this.pluralify(validDetail);
			} else if (validWords.length > 0) {
				return validWords[0];
			} else if (allowSeveral && minimumWords.length > 1) {
				return minimumWords[0] + " 和 " + minimumWords[1];
			} else {
				return defaultWord;
			}
		},
		
		pluralify: function (s) {
			if (s.endsWith("roach")) {
				return s + "";
			} else if (s[s.length - 1] !== "s") {
				return s + "";
			} else {
				return s;
			}
		},
		
		depluralify: function (s) {
			return s;
		},
		
		addArticle: function (s) {
            return this.getArticle(s) + "" + s;
		},
        
        getArticle: function (s) {
            switch (s.trim().charAt(0).toLowerCase()) {
                case "a":
                case "i":
                case "e":
                case "o":
                // u is often ambiguous use "a" until adding a fancier rule
                    return " 1 个";
                default:
                    return " 1 个";
            }
        },
		
		capitalize: function (string) {
			return string.charAt(0).toUpperCase() + string.slice(1);
		}
	};
		
	function initSectorTexts() {
		var d1 = TextConstants.densityBrackets[0][0];
		var d2 = TextConstants.densityBrackets[1][0];
		var d3 = TextConstants.densityBrackets[2][0];
		var d4 = TextConstants.densityBrackets[3][0];
		var r1 = TextConstants.repairBrackets[0][0];
		var r2 = TextConstants.repairBrackets[1][0];
		var r3 = TextConstants.repairBrackets[2][0];
		var r4 = TextConstants.repairBrackets[3][0];
		
		var sectorDesc = TextConstants.sectorDescriptions;
		
		sectorDesc[SECTOR_TYPE_NOLIGHT] = {};
		sectorDesc[SECTOR_TYPE_NOLIGHT][d1] = {};
		sectorDesc[SECTOR_TYPE_NOLIGHT][d1][r1] = "城市里少有的空旷空间;没有地板，没有墙，没有建筑，什么都没有。只有巨大的空洞的黑暗。";
		sectorDesc[SECTOR_TYPE_NOLIGHT][d1][r2] = sectorDesc[SECTOR_TYPE_NOLIGHT][d1][r1];
		sectorDesc[SECTOR_TYPE_NOLIGHT][d1][r3] = sectorDesc[SECTOR_TYPE_NOLIGHT][d1][r1];
		sectorDesc[SECTOR_TYPE_NOLIGHT][d1][r4] = sectorDesc[SECTOR_TYPE_NOLIGHT][d1][r1];
		sectorDesc[SECTOR_TYPE_NOLIGHT][d2] = {};
		sectorDesc[SECTOR_TYPE_NOLIGHT][d2][r1] = "一条宽阔的街道或走廊，看起来并没有经过很好的修复。在茫茫的黑暗中难以找到任何东西。";
		sectorDesc[SECTOR_TYPE_NOLIGHT][d2][r2] = sectorDesc[SECTOR_TYPE_NOLIGHT][d2][r1];
		sectorDesc[SECTOR_TYPE_NOLIGHT][d2][r3] = "一条宽阔的街道或走廊。在茫茫的黑暗中难以找到任何东西。";
		sectorDesc[SECTOR_TYPE_NOLIGHT][d2][r4] = sectorDesc[SECTOR_TYPE_NOLIGHT][d2][r3];
		sectorDesc[SECTOR_TYPE_NOLIGHT][d3] = {};
		sectorDesc[SECTOR_TYPE_NOLIGHT][d3][r1] = "带有废弃空气的街道或走廊。细节在黑暗中消逝。";
		sectorDesc[SECTOR_TYPE_NOLIGHT][d3][r2] = sectorDesc[SECTOR_TYPE_NOLIGHT][d3][r1];
		sectorDesc[SECTOR_TYPE_NOLIGHT][d3][r3] = "有几栋建筑物的街道或走廊。在黑暗中很难说出他们是什么。";
		sectorDesc[SECTOR_TYPE_NOLIGHT][d3][r4] = sectorDesc[SECTOR_TYPE_NOLIGHT][d3][r3];
		sectorDesc[SECTOR_TYPE_NOLIGHT][d4] = {};
		sectorDesc[SECTOR_TYPE_NOLIGHT][d4][r1] = "一条狭窄得几乎无法行走的通道，有许多尖锐的边缘，凹凸不平的小路和破碎的墙壁。你在黑暗中摸索着前进。";
		sectorDesc[SECTOR_TYPE_NOLIGHT][d4][r2] = sectorDesc[SECTOR_TYPE_NOLIGHT][d4][r1];
		sectorDesc[SECTOR_TYPE_NOLIGHT][d4][r3] = "一条狭窄的通道，几乎没有足够的空间行走。你在黑暗中摸索着前进。";
		sectorDesc[SECTOR_TYPE_NOLIGHT][d4][r4] = sectorDesc[SECTOR_TYPE_NOLIGHT][d4][r3];
		
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1] = "城市里少有的空旷空间;没有地板，没有墙，没有建筑，什么都没有。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r2] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r3] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r4] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d2] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d2][r1] = "这里曾经有个家，但现在除了废墟，没有什么别的东西了。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d2][r2] = "这里曾经有一些房子，但是很久没有修理过了。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d2][r3] = "一个寂静的广场，被许多废弃的公寓包围着";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d2][r4] = "一个方形的广场，被漂亮的公寓包围着，看起来好像还有人住在那一样。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d3] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d3][r1] = "这里曾经有个家，但现在除了废墟，没有什么别的东西了。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d3][r2] = "一条破旧的街道，两边排列着曾经的公寓。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d3][r3] = "安静的住宅区，两旁是正在缓慢衰败的公寓楼。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d3][r4] = "一条安静的街道，在两座高耸的公寓楼之间。两旁排列着树木，不久前还在人造灯光下茁壮成长。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d4] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d4][r1] = "一条密集的走廊与倒塌的公寓楼紧密相连，几乎没有足够的空间行走。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d4][r2] = "一条狭窄的走廊，在两个巨大的、破败的住宅楼之间，几乎没有足够的空间行走。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d4][r3] = "一条狭窄的，被遗忘的走廊，在两座高大的住宅楼之间，几乎没有足够的空间行走。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d4][r4] = "一个狭窄的，让人意识不到的走廊，在两个巨大的公寓楼之间，几乎没有足够的空间行走。";
		
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d1] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d1][r1] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d1][r2] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d1][r3] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d1][r4] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d2] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d2][r1] = "一个阴暗的工业广场，隐约可见一些大型的难以辨认的废墟。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d2][r2] = "一个宽阔的广场，一边是一个破败的工厂，另一边则是旧仓库的残骸。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d2][r3] = "一个宽阔的广场，一边是废弃的工厂，另一边则是旧仓库。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d2][r4] = "一个宽阔的简式的广场，一边是安静的工厂，另一边看起来像仓库。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d3] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d3][r1] = "以前的工业部门，工厂和车间都变成了废墟。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d3][r2] = "街道两旁都是毁坏的工厂，老鼠们聚集在这里避光。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d3][r3] = "街道被旧工厂和工业建筑环绕着。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d3][r4] = "被工厂和仓库环绕的工业街道。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d4] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d4][r1] = "一条密集的走廊与倒塌的公寓楼紧密相连，几乎没有足够的空间行走。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d4][r2] = "一个狭窄的走廊，在两个巨大的破败工厂之间，几乎没有足够的空间行走。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d4][r3] = "两个大工厂之间的维修走廊，几乎没有足够的行走空间。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_INDUSTRIAL][d4][r4] = "一条狭窄的工业街道，两旁耸立着高耸的、高度安全的自动化工厂。";
		
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d1] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d1][r1] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d1][r2] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d1][r3] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d1][r4] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d2] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d2][r1] = "一个空荡荡的、荒凉的广场，还有一些破损的电缆系统的残骸，纵横交错在低矮的天花板上。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d2][r2] = "一个空荡荡的广场，破旧的电缆系统的残骸穿过低矮的天花板。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d2][r3] = "一个空旷的广场，中间有一个控制室，旧的电缆系统穿过低矮的天花板。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d2][r4] = "一个交通大厅，最显眼的是维护良好的缆车线和空的出租车道，它们就在你的上方。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d3] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d3][r1] = "一个荒凉的走廊，纵横交错着破损的电缆系统和维修管道。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d3][r2] = "一条破损的街道，位于维修中心的后方，低矮的天花板上交错着老旧的电线和管道。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d3][r3] = "一条狭窄的街道，两旁排列着已经被废弃的用于城市服务的控制装置，这些控制装置曾被用于水力、电力、空气过滤和机器人制造等方面。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d3][r4] = "一个维护良好的运输大厅，有几部电梯和一个空缆车站。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d4] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d4][r1] = "一条密集的走廊，到处都是破损的维修管道和电缆，几乎没有足够的空间行走。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d4][r2] = "一条密集的走廊，充满了维修管道和断裂的电缆，几乎没有足够的空间通过。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d4][r3] = "一条密集的走廊，充满了维修管道和电缆，几乎没有足够的空间通过。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_MAINTENANCE][d4][r4] = "一条狭窄的走廊，连接着几个维修单位和控制室，里面充满了几乎无法通过的电缆和电线。";
		
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d1] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d1][r1] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d1][r2] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d1][r3] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d1][r4] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d2] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d2][r1] = "这似乎曾是一个集市广场，但现在除了废墟，已经不剩什么了。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d2][r2] = "一个废弃的集市广场，满满地都是商店的废墟，以及无言的广告牌。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d2][r3] = "一个安静的市场广场，满满地都是商店的废墟，以及无言的广告牌。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d2][r4] = "一个宽阔的市场广场，两边都是商业大厦，墙壁上覆盖着充满死亡感的黑色屏风。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d3] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d3][r1] = "这里似乎曾经有商店和集市，但现在除了废墟，已经不剩什么了。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d3][r2] = "一个空荡荡的走廊，两旁是商店和工匠工作室的废墟。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d3][r3] = "昔日的商业街，林立着废弃的商店和工匠的作坊。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d3][r4] = "一条昔日的购物街，两旁是安静的商店和工匠的工作室。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d4] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d4][r1] = "一条密集的走廊，与破烂的废墟紧密相连，几乎没有足够的空间行走。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d4][r2] = "一个狭窄的走廊，在两个巨大的破旧的购物楼之间，几乎没有足够的空间行走。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d4][r3] = "两个巨大的购物楼之间的狭窄走廊，几乎没有足够的空间行走。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_COMMERCIAL][d4][r4] = "在两个大型购物中心之间，有一条狭窄但维护很好的走廊，几乎没有足够的步行空间。";    
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d1] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d1][r1] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d1][r2] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d1][r3] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d1][r4] = sectorDesc[WorldCreatorConstants.SECTOR_TYPE_RESIDENTIAL][d1][r1];
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d2] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d2][r1] = "似乎曾经有人住在这里，但现在除了废墟什么都没有了。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d2][r2] = "这里有一些临时搭建的棚屋，但它们在很长一段时间内都没有修复过。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d2][r3] = "一处宽阔的广场，四周都是破损的临时住宅楼，这些楼房似乎从没通过电。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d2][r4] = "一处宽阔的广场，它的墙壁支撑着一些临时的棚屋。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d3] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d3][r1] = "这个地方似乎最后被用作一个临时居住的地方，但是现在除了废墟什么都没有。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d3][r2] = "一条被临时住所包围着的（在一些地方甚至挤满了）狭窄的贫民区街道，已经被废弃了一段时间了。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d3][r3] = "一条被临时住所包围着的（在一些地方甚至挤满了）狭窄的贫民区街道。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d3][r4] = "一条被新近的贫民区住所包围着的（在一些地方甚至挤满了）狭窄的街道。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d4] = {};
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d4][r1] = "一条密集的走廊与倒塌的棚屋紧密相连，几乎没有足够的空间行走。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d4][r2] = "一条肮脏的走廊，堆满了被遗弃很久的黑暗居民棚屋，几乎没有足够的空间来通过。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d4][r3] = "一条肮脏的走廊，堆满了被遗弃很久的黑暗居民棚屋，几乎没有足够的空间来通过。";
		sectorDesc[WorldCreatorConstants.SECTOR_TYPE_SLUM][d4][r4] = "一个最近有人居住的贫民窟，挤满了棚屋，几乎没有足够的空间可以通过。";
    }
    
    initSectorTexts();
    
    return TextConstants;
    
});
